package com.cskaoyan.mapper;

import com.cskaoyan.bean.Cart;
import com.cskaoyan.bean.CartExample;
import com.cskaoyan.bean.Coupon;
import com.cskaoyan.bean.cart.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CartMapper {
    long countByExample(CartExample example);

    int deleteByExample(CartExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Cart record);

    int insertSelective(Cart record);

    List<Cart> selectByExample(CartExample example);

    Cart selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Cart record, @Param("example") CartExample example);

    int updateByExample(@Param("record") Cart record, @Param("example") CartExample example);

    int updateByPrimaryKeySelective(Cart record);

    int updateByPrimaryKey(Cart record);


    Integer selectGoodsCount(@Param("userid") Integer userid);

    Integer selectCheckedGoodsCount(@Param("userid") Integer userid);

    Double selectGoodsAmount(@Param("userid") Integer userid);

    Double selectCheckGoodsAmount(@Param("userid") Integer userid);

    List<CartListBean> selectListBeans(@Param("userid") Integer userid);

    Integer addCart(@Param("cartListBean1") CartListBean  cartListBean1);


    void updateCart(@Param("cartUpdateBean") CartUpdateBean cartUpdateBean);

    void  delectCart(@Param("productId") Integer productId,@Param("userId")Integer userid);

    void updateChecked(@Param("productId") Integer productId, @Param("isChecked") Integer isChecked,@Param("userid")Integer userid);

    CheckedAddressBean selectAddress(@Param("addressId") Integer addressId);

    List<CheckedGoodsListBean> selectCheckedGoodsList(@Param("userId") Integer userId );

    Double selectCouponPrice(@Param("couponId") Integer couponId);

    Integer selectGrouponPrice(@Param("grouponRulesId")Integer grouponRulesId);

    Integer selectCouponTotal(@Param("totalPrice1") Double totalPrice, @Param("userId") Integer userId);

    List<Integer> selectFreightPrice();

    CartListBean selectMes(@Param("goodsId")Integer goodsId);


    String[] selectSpecifications(@Param("goodsId")Integer goodsId);


    List<Integer> selectCartId();

    Integer selectCartIsHaved(@Param("goodsId")Integer goodsId,@Param("userid") Integer userid);


    void updateCartNumber(@Param("goodsId")Integer goodsId,@Param("userid") Integer userid,@Param("number")Integer number);

    Integer selectCartByFastAddBean(@Param("fastAddBean") FastAddBean fastAddBean,@Param("userid") Integer userid);

    void insertCart();

    Integer selectCartIdIsHaved(@Param("goodsId")Integer goodsId,@Param("userid") Integer userid);

    Integer selectLastInsertId();


    List<CheckedGoodsListBean> selectByCartId(@Param("cartId")Integer cartId);

    Integer selectCountCoupons(@Param("userId") Integer userId, @Param("totalPrice1") double totalPrice1);

    Coupon selectMaxDiscount(@Param("userId") Integer userId, @Param("totalPrice1") double totalPrice1);
}
